package apof.model
{
	public class User extends ApofModel
	{
		public var uid:int;
		public var username:String;
		public var password:String;
		public var accounts:Array=new Array();
		public var consumeTypes:Array=new Array();
		public var filters:Array=new Array();
		//0:真实用户 1：收入水平标本 2：消费水平标本 3：消费结构标本 4：全体用户标本
		public var utype:int=0;
		public var structureType:int=-1;
		public var incomeLevel:int=-1;
		public var expenseLevel:int=-1;
		
		
		//private static var init:Boolean = onInit();
		public static function onInit():Boolean {
			var pt:Object=prototype;
			pt.classname="User";		
			pt.fields=["uid","username","password","utype","structureType","incomeLevel","expenseLevel"];
			pt.fieldTypes=["INT","VARCHAR(60)","VARVHAR(20)","int","int","int","int"];
			pt.primaryKey=["uid"];
			pt.foreignKey={	"accounts":		{"linkto":Account,		"aggregate":true,"ref":"accounts",		"peerlink":"uid"},
							"consumeTypes":	{"linkto":ConsumeType,	"aggregate":true,"ref":"consumeTypes",	"peerlink":"uid"},
							"filters":		{"linkto":Filter,		"aggregate":true,"ref":"filters",		"peerlink":"uid"}
							};
			return true;
		}
		
		public override function get classInfo():Object {return prototype;}
		public static function get classInfo():Object {return prototype;}	
	}
}